package com.code.day07.Streamsdy;

import java.util.ArrayList;
import java.util.stream.Stream;

public class StreamTest {
    public static void main(String[] args) {
        Stream<String> stream1 = Stream.of("我想吃大", "撒大大", "张三", "李斯");
        Stream<String> stream2 = Stream.of("张杰", "张伟", "张少", "刘东升", "王信", "张撒大声地");

        //第一个队伍只要名字为3个字的成员姓名
        Stream<String> onestream = stream1.filter(s -> s.length() == 3).limit(3);
        Stream<String> twostream = stream2.filter(s -> s.startsWith("张")).skip(2);


        Stream.concat(onestream, twostream).forEach(System.out::println);

    }
}
